<link rel="import" href="../../../html/polymer.html">

<link rel="import" href="chrome://resources/cr_elements/md_select_css.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_tooltip_icon.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="cr_policy_network_behavior_mojo.html">
<link rel="import" href="cr_policy_network_indicator_mojo.html">
<link rel="import" href="network_config_element_behavior.html">
<link rel="import" href="network_shared_css.html">
<link rel="import" href="onc_mojo.html">

<dom-module id="network-config-select">
  <template>
    <style include="cr-shared-style network-shared md-select">
      .md-select {
        color: var(--cr-primary-text-color);
        width: 100%;
      }

      #outer {
        align-items: stretch;
        display: flex;
        flex-direction: column;
        justify-content: center;
        margin-bottom: var(--cr-form-field-bottom-spacing);
        padding: 0;
      }

      #inner {
        align-items: center;
        display: flex;
        flex-direction: row;
      }

      cr-policy-network-indicator-mojo {
        --cr-tooltip-icon-margin-start: var(--cr-controlled-by-spacing);
      }
    </style>

    <div id="outer">
      <div id="label" class="cr-form-field-label">[[label]]</div>
      <div id="inner">
        <select class="md-select"
            disabled="[[getDisabled_(disabled, property)]]"
            value="{{value::change}}" aria-label$="[[label]]">
          <template is="dom-repeat" items="[[items]]">
            <option value="[[getItemValue_(item)]]"
                disabled="[[!getItemEnabled_(item, deviceCertsOnly)]]">
              [[getItemLabel_(item, key, oncPrefix)]]
            </option>
          </template>
        </select>
        <cr-policy-network-indicator-mojo
            property="[[property]]" tooltip-position="left">
        </cr-policy-network-indicator-mojo>
      </div>
    </div>

  </template>
  <script src="network_config_select.js"></script>
</dom-module>
